package indi.kider.server.applet.api;


import indi.kider.common.model.apabus.Reservation;
import indi.kider.server.applet.service.ReservationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import pers.vankid.common.model.base.CommonResponse;

@RestController
@RequestMapping(value = "reservation")
public class ReservationController {

    @Autowired
    private ReservationService reservationService;

    @PostMapping("applet/save")
    public CommonResponse<String> saveDestine(@RequestBody Reservation reservation){
        try {
            return CommonResponse.buildAddSuccessResponse(reservationService.saveReservation(reservation));
        } catch (Exception e) {
            return CommonResponse.buildExceptionResponse(e);
        }

    }
}
